Plan of analysis to be carried out

for simple diagrams,

for complex connections - sankey diagram - for the link between printing methods + printing model with a link to the bioink type (+ origin)?

first things first, to give numbers of studies that report e.g. A or B

Printing Techniques

Give an overview of the different printing techniques, - method - printer model - printer source - forms - software

Kind of Printer Method

t1 <- table(reconciled$`4.1 What kind of printing method is used?_ae684e28-4f90-44ad-9de2-731d076de0b0_Answer`)
##
        # Extrusion based Extrusion based|Unclear            Inject based 
        #              37                       1                       4 
        #           Other       Stereolithography                 Unclear 
        #               9                       2                      10

# proportions instead of absolute value of number of studies 
prop.table(table(reconciled$`4.1 What kind of printing method is used?_ae684e28-4f90-44ad-9de2-731d076de0b0_Answer`))
## 
##         Extrusion based Extrusion based|Unclear            Inject based 
##              0.58730159              0.01587302              0.06349206 
##                   Other       Stereolithography                 Unclear 
##              0.14285714              0.03174603              0.15873016
 # barplot(t1, ylab = "Number of studies", ylim=c(0, max(t1) + 20),cex.names=.5 , col = "green")

text(x = barplot(t1, ylab = "Number of studies", ylim=c(0, max(t1) + 10), cex.names=.5 , col = "green"), y = t1 + 2, labels = t1, cex = 0.8)

# -- link printing method with bioInk type - 

Reporting of Printer Model

#### Reporting of Printer Model

t2 <- table(reconciled$`4.1.1 Do the authors report the printer model name/number?_a3e72486-56d3-4154-a45f-9fb87b8612fc_Answer`)
         # Not reported Not reported|Reported              Reported 
         #           22                     1                    4


# barplot(table(reconciled$`4.1.1 Do the authors report the printer model name/number?_a3e72486-56d3-4154-a45f-9fb87b8612fc_Answer`), ylab = "Number of studies")

text(x = barplot(t2, ylab = "Number of studies", ylim=c(0, max(t2) + 10), cex.names=.5 , col = "green"), y = t2 + 2, labels = t2, cex = 0.8)

Printer Source

#### Reporting of Printer Source

t3 <- table(reconciled$`4.1.2 What is the source of the printer?_102ba965-5234-4b3e-8b23-bd70cf4e074d_Answer`)
         # commercial modified commercial        not reported 
         #         36                   4                   4 
         #  self-made             unclear  unclear|commercial 
         #         13                   5                   1

# barplot(table(reconciled$`4.1.2 What is the source of the printer?_102ba965-5234-4b3e-8b23-bd70cf4e074d_Answer`), ylab = "Number of studies", cex.names=.5,  col = "green")

text(x = barplot(t3, ylab = "Number of studies", ylim=c(0, max(t3) + 10), cex.names=.5 , col = "green"), y = t3 + 2, labels = t3, cex = 0.8)

Printer Forms

#### Reporting of Printer forms
# split is based on the ink

table(reconciled$`4.1.4 What kind of forms are printed with this ink?_01d3ca37-1e2f-4087-8f39-c183f98f0c4e_Answer`)
## 
##                        Grid                  Grid;Other 
##                          19                           1 
##                   Grid|Grid               lobular liver 
##                           2                           7 
##         lobular liver;Other lobular liver|lobular liver 
##                           1                           2 
##                       Other                 Other|Other 
##                          25                           5 
##                     Toroids 
##                           1
        #                Grid                  Grid;Other 
        #                  19                           1 
        #           Grid|Grid               lobular liver 
        #                   2                           7 
        # lobular liver;Other lobular liver|lobular liver 
        #                   1                           2 
        #               Other                 Other|Other 
        #                  25                           5 
        #             Toroids 
        #                   1

# ABB to clean these responses
# Those with a semicolon response ; should now be called "combo"
# responses separate with a pipe should be merged when they are saying the same thing. 

printer_forms <- reconciled %>% 
  mutate(`4.1.4 What kind of forms are printed with this ink?_01d3ca37-1e2f-4087-8f39-c183f98f0c4e_Answer`= recode(`4.1.4 What kind of forms are printed with this ink?_01d3ca37-1e2f-4087-8f39-c183f98f0c4e_Answer`, "Grid|Grid" = "Grid")) %>% 
  mutate(`4.1.4 What kind of forms are printed with this ink?_01d3ca37-1e2f-4087-8f39-c183f98f0c4e_Answer`= recode(`4.1.4 What kind of forms are printed with this ink?_01d3ca37-1e2f-4087-8f39-c183f98f0c4e_Answer`, "lobular liver|lobular liver" = "lobular liver")) %>% 
  mutate(`4.1.4 What kind of forms are printed with this ink?_01d3ca37-1e2f-4087-8f39-c183f98f0c4e_Answer`= recode(`4.1.4 What kind of forms are printed with this ink?_01d3ca37-1e2f-4087-8f39-c183f98f0c4e_Answer`, "Other|Other" = "Other")) %>% 
  mutate(`4.1.4 What kind of forms are printed with this ink?_01d3ca37-1e2f-4087-8f39-c183f98f0c4e_Answer`= recode(`4.1.4 What kind of forms are printed with this ink?_01d3ca37-1e2f-4087-8f39-c183f98f0c4e_Answer`, "Grid;Other" = "Combination")) %>% 
  mutate(`4.1.4 What kind of forms are printed with this ink?_01d3ca37-1e2f-4087-8f39-c183f98f0c4e_Answer`= recode(`4.1.4 What kind of forms are printed with this ink?_01d3ca37-1e2f-4087-8f39-c183f98f0c4e_Answer`, "lobular liver;Other" = "Combination"))

t4 <-table(printer_forms$`4.1.4 What kind of forms are printed with this ink?_01d3ca37-1e2f-4087-8f39-c183f98f0c4e_Answer`)


# barplot(table(printer_forms$`4.1.4 What kind of forms are printed with this ink?_01d3ca37-1e2f-4087-8f39-c183f98f0c4e_Answer`), ylab = "Number of studies", cex.names=.5 , col = "green")

text(x = barplot(t4, ylab = "Number of studies", ylim=c(0, max(t4) + 10), cex.names=.5 , col = "green"), y = t4 + 2, labels = t4, cex = 0.8)

Printer Forms Overtime

printer_form_year<- table(printer_forms$`4.1.4 What kind of forms are printed with this ink?_01d3ca37-1e2f-4087-8f39-c183f98f0c4e_Answer`, printer_forms$NA_Year)


printer_form_yearDF <- as.data.frame(printer_form_year)
# long to wide 
printer_form_yearDF <- printer_form_yearDF %>% spread(
   key = Var2, 
   value = Freq)


# printer_form_yearDF 
# names(printer_form_yearDF) <- gsub(x = names(printer_form_yearDF), pattern = "X", replacement = "")  


library(formattable)

formattable(printer_form_yearDF,
            #align =c("l", "r"),
            list(
              `Indicator Name` = formatter(
              "span", 
              style = ~ style(color = "grey",font.weight = "bold")), 
             area(row = 1:5) ~ color_tile("white", "green")))
## Warning in gradient(as.numeric(x), ...): NAs introduced by coercion
Var1 2010 2011 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022
Grid 0 0 0 1 0 2 4 4 1 4 5 0
Combination 0 0 0 0 0 0 0 1 0 1 0 0
lobular liver 0 0 0 0 0 1 0 2 1 2 2 1
Other 1 1 1 0 1 5 2 6 3 5 2 3
Toroids 0 0 0 0 1 0 0 0 0 0 0 0

Printer Software

#### Reporting of Printer software

table(reconciled$`4.1.5 Do the authors report the name of the 3D modelling software?_f88d82a9-410c-4118-ad6a-4535d12c4aca_Answer`)
## 
##             No          No|No Not applicable            Yes 
##             39              1              1             22
            # No          No|No Not applicable            Yes 
            # 39              1              1             22

## ABB combine No|No into the "No" group 
printer_soft <- reconciled %>% 
  mutate(`4.1.5 Do the authors report the name of the 3D modelling software?_f88d82a9-410c-4118-ad6a-4535d12c4aca_Answer` = recode(`4.1.5 Do the authors report the name of the 3D modelling software?_f88d82a9-410c-4118-ad6a-4535d12c4aca_Answer`, "No|No" = "No") )

t5 <- table(printer_soft$`4.1.5 Do the authors report the name of the 3D modelling software?_f88d82a9-410c-4118-ad6a-4535d12c4aca_Answer`)

# barplot(table(printer_soft$`4.1.5 Do the authors report the name of the 3D modelling software?_f88d82a9-410c-4118-ad6a-4535d12c4aca_Answer`), ylab = "Number of studies", cex.names=.5, col = "green")

text(x = barplot(t5, ylab = "Number of studies", ylim=c(0, max(t5) + 10), cex.names=.5 , col = "green"), y = t5 + 2, labels = t5, cex = 0.8)

## Slicing Software

# - since the review started, many cases - not applicable 
# merge NA with No and merge No|No with NO
table(reconciled$`4.1.6 Do the authors report the name of slicing software?_bc07fc45-10aa-441f-9bdf-b32f5037389f_Answer`)
## 
##             No          No|No Not applicable            Yes 
##             53              1              1              8
            # No          No|No Not applicable            Yes 
            # 53              1              1              8 

## ABB to clean No|No and Not applicable into the No option. 

printer_slice <- printer_soft %>% 
  mutate(`4.1.6 Do the authors report the name of slicing software?_bc07fc45-10aa-441f-9bdf-b32f5037389f_Answer` = recode(`4.1.6 Do the authors report the name of slicing software?_bc07fc45-10aa-441f-9bdf-b32f5037389f_Answer`, "No|No" = "No")) %>% 
   mutate(`4.1.6 Do the authors report the name of slicing software?_bc07fc45-10aa-441f-9bdf-b32f5037389f_Answer` = recode(`4.1.6 Do the authors report the name of slicing software?_bc07fc45-10aa-441f-9bdf-b32f5037389f_Answer`, "Not applicable" = "No"))

t6 <- table(printer_slice$`4.1.6 Do the authors report the name of slicing software?_bc07fc45-10aa-441f-9bdf-b32f5037389f_Answer`)


# t6_6 <- table(printer_slice$`4.1.6 Do the authors report the name of slicing software?_bc07fc45-10aa-441f-9bdf-b32f5037389f_Answer`, printer_slice$`4.1.5 Do the authors report the name of the 3D modelling software?_f88d82a9-410c-4118-ad6a-4535d12c4aca_Answer`)
# t6_6
# barplot(table(printer_slice$`4.1.6 Do the authors report the name of slicing software?_bc07fc45-10aa-441f-9bdf-b32f5037389f_Answer`), ylab = "Number of studies", cex.names=.5, col = "green")

text(x = barplot(t6, ylab = "Number of studies", ylim=c(0, max(t6) + 10), cex.names=.5 , col = "green", main = "Is the name of the slicing software reported?"), y = t6 + 2, labels = t6, cex = 0.8, )

#####
# stacked barplot to combine software & slice software

# library(ggplot2)
# 
# software <- printer_slice %>% 
#                       group_by(`4.1.5 Do the authors report the name of the 3D modelling software?_f88d82a9-410c-4118-ad6a-4535d12c4aca_Answer`, printer_slice$`4.1.6 Do the authors report the name of slicing software?_bc07fc45-10aa-441f-9bdf-b32f5037389f_Answer`) %>% count()
# 
# colnames(software) <- c("threeD-software", "slice-software", "number-studies")
# 
# #, printer_slice$`4.1.5 Do the authors report the name of the 3D modelling software?_f88d82a9-410c-4118-ad6a-4535d12c4aca_Answer`))
# 
# ggplot(software, aes(fill=`slice-software`, y=`number-studies`, x=`threeD-software`)) + 
#   geom_bar(position='stack', stat='identity')

#software$`number-studies`


############

BioInks

Give an overview of the different inks used with these techniques. - type - origin - additives - density

ABB link bioink to printing method

## Type of BioInk
table(reconciled$`4.1.3 What type of bioink was used?_92421414-c597-4e9c-b720-9bb4318b5483_Answer`)
## 
##              Natural      Natural|Natural    Natural|Synthetic 
##                   43                    3                    5 
##         Not reported Not reported|Natural            Synthetic 
##                    2                    1                    4 
##              Unclear 
##                    5
# clean? 

        #      Natural      Natural|Natural    Natural|Synthetic 
        #           43                    3                    5 
        # Not reported Not reported|Natural            Synthetic 
        #            2                    1                    4 
        #      Unclear 
        #            5 

barplot(table(reconciled$`4.1.3 What type of bioink was used?_92421414-c597-4e9c-b720-9bb4318b5483_Answer`), ylab = "Number of studies", cex.names=.5, col = "blue")

## If natural - what is the type type
table(reconciled$`4.1.3.1.1 If natural bioink, please choose the type._66b761ad-6630-4323-b423-c848a717aae4_Answer`)
## 
##                                                                 Other 
##                                                                     1 
##                                                  Polysaccharide based 
##                                                                    10 
##                                       Polysaccharide based;dECM based 
##                                                                     1 
##                                                         Protein based 
##                                                                    14 
##                                              Protein based;dECM based 
##                                                                     8 
##                                    Protein based;Polysaccharide based 
##                                                                    13 
##                         Protein based;Polysaccharide based;dECM based 
##                                                                     1 
##                              Protein based;Polysaccharide based;Other 
##                                                                     1 
## Protein based;Polysaccharide based|Protein based;Polysaccharide based 
##                                                                     1 
##                                              Protein based|dECM based 
##                                                                     1 
##                                           Protein based|Protein based 
##                                                                     1
# output needs cleaning 


table(reconciled$`4.1.3.1.4 If Synthetic bioink: choose the type _e74ea0e0-a654-4ae2-b59e-2e0b14a4651a_Answer`)
## 
##                      Other                   Pluronic 
##                          3                          3 
## Poly ethylene glycol (PEG) 
##                          3
## 3rd level 
table(reconciled$`4.1.3.1.2 If Protein based: choose the type._621671b3-9f7e-4a22-80ac-14b02fdd0683_Answer`)
## 
##            Collagens    Collagens;Gelatin  Collagens|Collagens 
##                    7                    3                    1 
##           Fibrinogen     Fibrinogen;Other              Gelatin 
##                    1                    1                   21 
##   Gelatin;Fibrinogen        Gelatin;Other Gelatin;Silk-fibroin 
##                    1                    2                    1 
##      Gelatin|Gelatin                Other 
##                    1                    1
table(reconciled$`4.1.3.1.3 If Polysaccharides Based: choose the type. _fcea8bcb-da6c-4154-aa44-8ff4734fa4fe_Answer`) 
## 
##                         Agarose                       Alginates 
##                               1                              19 
##                 Alginates;Other                        Chitosan 
##                               4                               1 
##                 Hyaluronic acid Hyaluronic acid|Hyaluronic acid 
##                               1                               1
## Origin of BioInk 
table(reconciled$`4.1.3.2. What is the origin of the bioink?_34ef46b6-34ac-4ddb-a5de-07bc74272fca_Answer`)
## 
##           commercial (ready-to-use)                   custom formulated 
##                                   6                                  44 
## custom formulated|custom formulated                        Not reported 
##                                   8                                   2 
##                             Unclear                     Unclear|Unclear 
##                                   2                                   1
# needs cleaning

#           commercial (ready-to-use)                   custom formulated 
#                                   6                                  44 
# custom formulated|custom formulated                        Not reported 
#                                   8                                   2 
#                             Unclear                     Unclear|Unclear 
#                                   2                                   1 

barplot(table(reconciled$`4.1.3.2. What is the origin of the bioink?_34ef46b6-34ac-4ddb-a5de-07bc74272fca_Answer`), ylab = "Number of studies", cex.names=.5, col = "blue")

### Additives
# -- needs cleaning 
table(reconciled$`4.1.3.3 Which information is provided on the additives in the ink or culture? _4c2b5908-9c3c-4ba8-91f2-dd9771ac2ad4_Answer`)
## 
##                                                                   Concentration 
##                                                                               9 
##                                                      Concentration;Manufacturer 
##                                                                              25 
##                                         Concentration;Manufacturer;Order number 
##                                                                               8 
## Concentration;Manufacturer;Order number|Concentration;Manufacturer;Order number 
##                                                                               2 
##                           Concentration;Manufacturer|Concentration;Manufacturer 
##                                                                               4 
##                                        Concentration|Concentration;Manufacturer 
##                                                                               1 
##                                                                    Manufacturer 
##                                                                               1 
##                                                                            None 
##                                                                              11 
##                                                 None|Concentration;Manufacturer 
##                                                                               1 
##                                                                       None|None 
##                                                                               1
# needs cleaning


## Cell density of bioInk
table(reconciled$`4.1.3.4 Is the cell density of the bioink provided in the study? _d03a497a-c8ab-49a6-8fa7-5eca0d168c94_Answer`)
## 
##      No   No|No  No|Yes     Yes  Yes|No Yes|Yes 
##      11       1       1      43       1       6
# needs cleaning 

     # No   No|No  No|Yes     Yes  Yes|No Yes|Yes 
     # 11       1       1      43       1       6 

BioInk Sunburst plot

#### BIOINK sunburst 

# type --> 
bioink <- reconciled %>%select(
  study_ID, 
    `4.1.3 What type of bioink was used?_92421414-c597-4e9c-b720-9bb4318b5483_Answer`, 
    `4.1.3.1.1 If natural bioink, please choose the type._66b761ad-6630-4323-b423-c848a717aae4_Answer`, 
    `4.1.3.1.4 If Synthetic bioink: choose the type _e74ea0e0-a654-4ae2-b59e-2e0b14a4651a_Answer`, `4.1.3.1.2 If Protein based: choose the type._621671b3-9f7e-4a22-80ac-14b02fdd0683_Answer`, 
`4.1.3.1.3 If Polysaccharides Based: choose the type. _fcea8bcb-da6c-4154-aa44-8ff4734fa4fe_Answer`
  )  


bioink <- bioink  %>% rename(typeGeneral_level1 = `4.1.3 What type of bioink was used?_92421414-c597-4e9c-b720-9bb4318b5483_Answer`, 
   typeNatural_level2       = `4.1.3.1.1 If natural bioink, please choose the type._66b761ad-6630-4323-b423-c848a717aae4_Answer`, 
  typeSynthetic_level2 = `4.1.3.1.4 If Synthetic bioink: choose the type _e74ea0e0-a654-4ae2-b59e-2e0b14a4651a_Answer`, 
  typeProtein_level3 = `4.1.3.1.2 If Protein based: choose the type._621671b3-9f7e-4a22-80ac-14b02fdd0683_Answer`, 
  typePoly_level3 = `4.1.3.1.3 If Polysaccharides Based: choose the type. _fcea8bcb-da6c-4154-aa44-8ff4734fa4fe_Answer`
)

bioink_split1 <- separate_rows(bioink, typeGeneral_level1 , sep="\\|")
bioink_split1_1 <- separate_rows(bioink_split1, typeNatural_level2 , sep="\\|")

bioink_split1_2 <- separate_rows(bioink_split1_1, typeProtein_level3 , sep="\\|")

bioink_split1_3 <- separate_rows(bioink_split1_2, typePoly_level3 , sep="\\|")

bioink_split2 <- separate_rows(bioink_split1_2, typeNatural_level2 , sep=";")
bioink_split3 <- separate_rows(bioink_split2, typeProtein_level3 , sep=";")
bioink_split3 <- separate_rows(bioink_split3, typePoly_level3 , sep=";")
# 148 rows

test_bio <- bioink_split3 %>%
     mutate(typeNatural_level2 = replace(typeNatural_level2, typeGeneral_level1!="Natural", NA), 
            typeSynthetic_level2 = replace(typeSynthetic_level2, typeGeneral_level1!="Synthetic", NA), 
            typeProtein_level3 = replace(typeProtein_level3, typeNatural_level2!="Protein based", NA), 
            typePoly_level3 =  replace(typePoly_level3, typeNatural_level2!="Polysaccharide based", NA)
            )

test_bio$typeSynthetic_level2 <- as.character(test_bio$typeSynthetic_level2)
  

### merge level 2 & merge level 3 
 test_bio$level3 <- ifelse(!is.na(test_bio$typeProtein_level3), test_bio$typeProtein_level3, test_bio$typePoly_level3)
 
  test_bio$level2 <- ifelse(!is.na(test_bio$typeNatural_level2), test_bio$typeNatural_level2, test_bio$typeSynthetic_level2)

  

#### START PLOTTING

library(dplyr)
library(plotme)


bioInk_count <-  count(test_bio, 
                       typeGeneral_level1, 
                       level2,
                       level3,
                       study_ID)


# sunburst plot
count_to_sunburst(bioInk_count)
# fill by group size
count_to_sunburst(bioInk_count, fill_by_n = TRUE)
# treemap plot, ordered by group size
count_to_treemap(bioInk_count, sort_by_n = TRUE)

Liver Cells

And then it is liver specific variables. - main type of liver cells - info about liver cells

AND - Main type of liver cells

if comments from reconciled - print out for all to see.

if any of reviewer comments say HepG2

table(reconciled$`2.2 What is the main type of liver cells included?_9bea404f-a75c-401f-af5b-8fd020306538_Answer`)
## 
##                       Hepatoma cells                 Hepatoma cells;Other 
##                                   34                                    2 
##       Induced pluripotent stem cells Induced pluripotent stem cells;Other 
##                                    3                                    1 
##                                Other                        Primary cells 
##                                    7                                   14 
##         Primary cells;Hepatoma cells                  Primary cells;Other 
##                                    1                                    1
# clean? - Maren to clean 

      #                 Hepatoma cells                 Hepatoma cells;Other 
      #                             28                                    2 
      # Induced pluripotent stem cells Induced pluripotent stem cells;Other 
      #                              3                                    1 
      #                          Other                        Primary cells 
      #                             12                                   14 
      #   Primary cells;Hepatoma cells                  Primary cells;Other 
      #                              2                                    1 

### combine the ones with semi-colon - into a new category called "Combination"

barplot(table(reconciled$`2.2 What is the main type of liver cells included?_9bea404f-a75c-401f-af5b-8fd020306538_Answer`), ylab = "Number of studies", cex.names=.5, col = "turquoise")

# ABB bring in the "other" from comments box 

table(reconciled$`2.2 What is the main type of liver cells included?_9bea404f-a75c-401f-af5b-8fd020306538_Comments`)
## 
##                                                                                   AML12 hepatic parenchymal cells (murine) 
##                                                                                                                          1 
##                                                                                              bone marrow mesenchymal cells 
##                                                                                                                          1 
##                                                                                      cells isolated from cholangiocarinoma 
##                                                                                                                          1 
##                                                                                    cryopreserved primary human hepatocytes 
##                                                                                                                          1 
##                                                                                                from healthy liver biopsies 
##                                                                                                                          1 
##                                                                                                                      Heb3B 
##                                                                                                                          1 
##                                                                                                                      Hep3B 
##                                                                                                                          1 
##                                                                                                                    Hep3B\n 
##                                                                                                                          1 
##                                                                                                                     HepaRG 
##                                                                                                                          3 
##                                                                            HepaRG cells, LX-2 (hepatic stellate cell line) 
##                                                                                                                          1 
##                                           hepatocyte-like cells differentiated from adipose-derived mesenchymal stem cells 
##                                                                                                                          1 
##                                                 hepatocyte-like cells directly converted from murine embryonic fibroblasts 
##                                                                                                                          1 
##                                                  Hepatoma cells: derived from collagenase digestion of human HCC samples\n 
##                                                                                                                          1 
##                                                                                                                      HepG2 
##                                                                                                                         18 
##                                                                                                                  HepG2 C3A 
##                                                                                                                          1 
##                                                                                                                    HepG2\n 
##                                                                                                                          1 
##                                                                                                                  HepG2/C3A 
##                                                                                                                          4 
##                                                           HepG2; human bone marrow-derived mesenchymal stem cells (BMMSCs) 
##                                                                                                                          1 
##                                                                                                              hiHep cells\n 
##                                                                                                                          1 
##                                                                                                                    HMCS1SA 
##                                                                                                                          1 
##                                                                                                                      Huh-7 
##                                                                                                                          1 
##                                                                                                           Huh-7 and HepaRG 
##                                                                                                                          1 
##                            human adipose-derived stem cells (hASCs) differentiated towards hepatocyte-like cells (AHLCs)\n 
##                                                                                                                          1 
##                                                       human adipose-derived stem cells were differntiated into hepatocytes 
##                                                                                                                          1 
## Human induced pluripotent stem (hiPS) cell lines\nRCi-22 and RCi-50 and hESC lines RC-6 and RC-10, hESC-HLCs were printed. 
##                                                                                                                          1 
##                                                                                             Human iPSC-derived hepatocytes 
##                                                                                                                          1 
##                                                                                                   Mouse primary hepatocyte 
##                                                                                                                          1 
##                                                                    Organoids from biopsies; immortalized cell line - HepG2 
##                                                                                                                          1 
##                                                                                               primary cell liver spheroids 
##                                                                                                                          1 
##                                                                                    primary cryopreserved human hepatocytes 
##                                                                                                                          1 
##                                                                                     primary hepatocytes from murine livers 
##                                                                                                                          1 
##                                        primary human hepatocytes, other cells from liver: hepatic stellate cells; (HUVECs) 
##                                                                                                                          1 
## primary human hepatocytes; human hepatic stellate cell line (LX2); primary fetal activated hepatic stellate cells (aHSC)\n 
##                                                                                                                          1 
##                                                                                                  primary mouse hepatocytes 
##                                                                                                                          1 
##                                                                                                  primary rat hepatocytes\n 
##                                                                                                                          1
## clean the type of liver cells comments

liverType <- tibble(
  
  study_ID = reconciled$study_ID, 
  liverCells = reconciled$`2.2 What is the main type of liver cells included?_9bea404f-a75c-401f-af5b-8fd020306538_Answer`, 
  liverCellsComment = reconciled$`2.2 What is the main type of liver cells included?_9bea404f-a75c-401f-af5b-8fd020306538_Comments`
  
)


# remove line breaks
library(stringr)
liverType$liverCellsComment <- str_replace_all(liverType$liverCellsComment, "[\n]" , "")

## group the mouse ones together 

# create categories
liverType$liverCellsComment <- as.factor(liverType$liverCellsComment)

commentsLiver <- liverType %>%  group_by(liverCellsComment) %>% summarise(n_unique = length(unique(study_ID))) %>%  arrange(desc(n_unique))


#install.packages("formattable")
library(formattable)

formattable(commentsLiver,
            align =c("l", "r"),
            list(`Indicator Name` = formatter(
              "span", style = ~ style(color = "grey",font.weight = "bold")), 
              `n_unique`= color_bar("turquoise")
))
liverCellsComment n_unique
HepG2 19
NA 6
HepG2/C3A 4
HepaRG 3
Hep3B 2
AML12 hepatic parenchymal cells (murine) 1
bone marrow mesenchymal cells 1
cells isolated from cholangiocarinoma 1
cryopreserved primary human hepatocytes 1
from healthy liver biopsies 1
Heb3B 1
HepaRG cells, LX-2 (hepatic stellate cell line) 1
hepatocyte-like cells differentiated from adipose-derived mesenchymal stem cells 1
hepatocyte-like cells directly converted from murine embryonic fibroblasts 1
Hepatoma cells: derived from collagenase digestion of human HCC samples 1
HepG2 C3A 1
HepG2; human bone marrow-derived mesenchymal stem cells (BMMSCs) 1
hiHep cells 1
HMCS1SA 1
Huh-7 1
Huh-7 and HepaRG 1
human adipose-derived stem cells (hASCs) differentiated towards hepatocyte-like cells (AHLCs) 1
human adipose-derived stem cells were differntiated into hepatocytes 1
Human induced pluripotent stem (hiPS) cell linesRCi-22 and RCi-50 and hESC lines RC-6 and RC-10, hESC-HLCs were printed. 1
Human iPSC-derived hepatocytes 1
Mouse primary hepatocyte 1
Organoids from biopsies; immortalized cell line - HepG2 1
primary cell liver spheroids 1
primary cryopreserved human hepatocytes 1
primary hepatocytes from murine livers 1
primary human hepatocytes, other cells from liver: hepatic stellate cells; (HUVECs) 1
primary human hepatocytes; human hepatic stellate cell line (LX2); primary fetal activated hepatic stellate cells (aHSC) 1
primary mouse hepatocytes 1
primary rat hepatocytes 1
#### how is LIVER model Cultered? 

table(reconciled$`2.2.1 How is the presented liver model cultured?_b6e561ab-c358-47fa-b9db-61e363b73223_Answer`)
## 
##  Co-culture Monoculture     Unclear 
##          33          29           1
 # Co-culture Monoculture     Unclear 
 #         33          29           1 


barplot(table(reconciled$`2.2.1 How is the presented liver model cultured?_b6e561ab-c358-47fa-b9db-61e363b73223_Answer`), ylab = "Number of studies", cex.names=.7, col = "turquoise")

# If co-culter - what type of non-parenchymal cells 
# - need to clean
table(reconciled$`2.2.1.1 If co-cultured, what type of non-parenchymal cells are included?_b729a62f-2dc7-47b6-ada7-e1ed8e363918_Answer`)
## 
##                                     Endothelial cells 
##                                                     7 
##              Endothelial cells;Hepatic stellate cells 
##                                                     5 
##                               Endothelial cells;Other 
##                                                     6 
##                                Hepatic stellate cells 
##                                                     2 
## Immune cells;Endothelial cells;Hepatic stellate cells 
##                                                     1 
##                   Immune cells;Hepatic stellate cells 
##                                                     2 
##                                                 Other 
##                                                    10
# Maren to clean manually - bring in "other" responses from comments box



# LIVER Model

table(reconciled$`3.1 Does the study present a vascularization of the model?_3b31a6ff-4233-4f24-9e7e-2d2eb3c83420_Answer`)
## 
##                     No    Yes, with perfusion Yes, without perfusion 
##                     52                      5                      6
                    # No    Yes, with perfusion Yes, without perfusion 
                    # 52                      5                      6


barplot(table(reconciled$`3.1 Does the study present a vascularization of the model?_3b31a6ff-4233-4f24-9e7e-2d2eb3c83420_Answer`), ylab = "Number of studies", cex.names=.7, col = "turquoise")

## hypoxia 
table(reconciled$`3.2 Do the authors address hypoxia/normoxia/oxygenation of the liver model?_5b050ea7-da29-4a47-bdea-23edda5877f2_Answer`)
## 
##                  No Yes, by measurement    Yes, descriptive 
##                  59                   1                   3
                 # No Yes, by measurement    Yes, descriptive 
                 # 59                   1                   3
barplot(table(reconciled$`3.2 Do the authors address hypoxia/normoxia/oxygenation of the liver model?_5b050ea7-da29-4a47-bdea-23edda5877f2_Answer`), ylab = "Number of studies", cex.names=.7, col = "turquoise")

Liver Cell Meta-Data

# Meta-data for Liver cells

table(reconciled$`2.4 Which kind of meta data is available for the used liver cells?_2868ee50-2c4c-47e8-a040-427e4f882632_Answer`)
## 
##                      Age         Common cell line    Common cell line;None 
##                        2                       33                        4 
##            Health status                     None                  Sex;Age 
##                        1                       16                        2 
## Sex;Age;Common cell line    Sex;Age;Health status 
##                        2                        3
## common cell line; None should get merged with Common Cell line option 
# re-shape data to can number of bits of info? 

liverCell_meta <- reconciled %>% mutate(`2.4 Which kind of meta data is available for the used liver cells?_2868ee50-2c4c-47e8-a040-427e4f882632_Answer` = recode(`2.4 Which kind of meta data is available for the used liver cells?_2868ee50-2c4c-47e8-a040-427e4f882632_Answer`, "Common cell line;None" = "Common cell line"))

liverMetaData <- separate_rows(liverCell_meta, `2.4 Which kind of meta data is available for the used liver cells?_2868ee50-2c4c-47e8-a040-427e4f882632_Answer` ,sep=";")


liverMetaData_heat <- liverMetaData[,c(1, 58)]

colnames(liverMetaData_heat) <- c("study_ID", "metaData")

countsMetaDat <- liverMetaData_heat %>% group_by(study_ID) %>% summarize(n_unique = length(unique(metaData)))

table(countsMetaDat$n_unique)
## 
##  1  2  3 
## 56  2  5
#  1  2  3 
# 56  2  5 

hist(countsMetaDat$n_unique, xlab = "Number of Meta-Data Items Reported", ylab = "Number of Papers", main = "Meta-Data Items about the Cell Lines Peformed per Paper", breaks = 3)

Cells

What types of included cells? - human, animal, both

table(reconciled$`2.1 What is the origin of the cells in the liver model?_d2a55b1d-f869-4fa4-83a1-94eeb126c6fb_Answer`)
## 
## Animal   Both  Human 
##      4     14     45
#
# Animal   Both  Human 
#      4     14     45 

barplot(table(reconciled$`2.1 What is the origin of the cells in the liver model?_d2a55b1d-f869-4fa4-83a1-94eeb126c6fb_Answer`), ylab = "Number of studies", cex.names=.7, col = "pink")

If human, is it Xeno-free?

table(reconciled$`2.1.1 If human, is the described liver model xeno-free/animal-free?_7b2396a2-218d-462b-b71f-0c68bc5e9911_Answer`)
## 
##      No Unclear 
##      43       2
barplot(table(reconciled$`2.1.1 If human, is the described liver model xeno-free/animal-free?_7b2396a2-218d-462b-b71f-0c68bc5e9911_Answer`)
, ylab = "Number of studies", cex.names=.7, col = "pink")

Culture Conditions

What type of culture conditions? Liver Markers- what measurements?

table(reconciled$`5.2 How long were the liver models cultured after printing?_1f136f0a-786b-4e17-a97d-e5cf32f47b26_Answer`)
## 
##         < 72 hours 2 weeks - 3 months   3 days - 2 weeks       not reported 
##                  2                 16                 42                  3
        # < 72 hours 2 weeks - 3 months   3 days - 2 weeks       not reported 
        #          2                 16                 42                  3 
barplot(table(reconciled$`5.2 How long were the liver models cultured after printing?_1f136f0a-786b-4e17-a97d-e5cf32f47b26_Answer`), ylab = "Number of studies", cex.names=.5, col = "purple")

## ABB to order these in time order 

Liver Markers

# WHICH
t <- table(reconciled$`6.1 Which liver markers were analysed in the presented model?_1844378b-1400-4d7a-b9f5-5538df7c7b76_Answer`)
# clean? 


liverMarkers <- separate_rows(reconciled, `6.1 Which liver markers were analysed in the presented model?_1844378b-1400-4d7a-b9f5-5538df7c7b76_Answer` ,sep=";")

markers_heat <- liverMarkers[,c(1, 94)]

colnames(markers_heat) <- c("study_ID", "marker")

new_marker <- markers_heat %>% group_by(marker) %>% summarize(n_unique = length(unique(study_ID)))

new_marker$n_unique <- as.numeric(new_marker$n_unique)

sort_new_marker <- new_marker %>% arrange(desc(n_unique))



#install.packages("formattable")
library(formattable)

formattable(sort_new_marker,
            align =c("l", "r"),
            list(`Indicator Name` = formatter(
              "span", style = ~ style(color = "grey",font.weight = "bold")), 
              `n_unique`= color_bar("yellow")
))
marker n_unique
Other 40
None 19
Lactate dehydrogenase (LDH) 9
Alanine aminotransferase (ALT) 2
Alkaline phosphatase (ALP) 1
Aspartate aminotransferase (AST) 1
Gamma-glutamyl transferase (GGT) 1
######################
# liver marker "Other"

t <- table(reconciled$`6.1 Which liver markers were analysed in the presented model?_1844378b-1400-4d7a-b9f5-5538df7c7b76_Comments`)

## clean the type of liver cells comments


liverMarkerComments_rows <- separate_rows(reconciled, `6.1 Which liver markers were analysed in the presented model?_1844378b-1400-4d7a-b9f5-5538df7c7b76_Comments`
   ,sep=";")

liverMarkerComments <- tibble(
  study_ID = liverMarkerComments_rows$study_ID, 
  liverMarker = liverMarkerComments_rows$`6.1 Which liver markers were analysed in the presented model?_1844378b-1400-4d7a-b9f5-5538df7c7b76_Answer`, 
  liverMarkerComment = liverMarkerComments_rows$`6.1 Which liver markers were analysed in the presented model?_1844378b-1400-4d7a-b9f5-5538df7c7b76_Comments`
  
)

# remove line breaks
library(stringr)
liverMarkerComments$liverMarkerComment <- str_replace_all(liverMarkerComments$liverMarkerComment, "[\n]" , "")

liverMarkerComments_rows <- separate_rows(liverMarkerComments,liverMarkerComment
   ,sep=",")

liverMarkerComments_rows <- separate_rows(liverMarkerComments_rows,liverMarkerComment
   ,sep=" and")

# # would replace all white space
# liverMarkerComments$liverMarkerComment <- str_replace_all(liverMarkerComments$liverMarkerComment, "[^\d]+" , "")

# remove line breaks
liverMarkerComments_rows$liverMarkerComment <- str_replace_all(liverMarkerComments_rows$liverMarkerComment, "[\n]" , "")

# remove whitespace from start of str
liverMarkerComments_rows$liverMarkerComment <- str_trim(liverMarkerComments_rows$liverMarkerComment, "left")

# remove whitespace from end of str
liverMarkerComments_rows$liverMarkerComment <- str_trim(liverMarkerComments_rows$liverMarkerComment, "right")

liverMarkerComments_clean <- liverMarkerComments_rows %>%  
          mutate(liverMarkerComment = recode(liverMarkerComment,
                                       "albumin" = "Albumin", 
                                       "ALB" = "Albumin", 
                                       " ALB" = "Albumin",
                                       "    ALB" = "Albumin",
                                       "albumin ELISA" = "Albumin", 
                                       "Albumin " = "Albumin",
                                        "albumin (ALB)" = "Albumin", 
                                       "qPCR: albumin" = "Albumin",
                                       " Albumin" =  "Albumin",
                                       "human albumin" =  "Albumin",
                                       
                                       "urea" = "Urea", 
                                       "urea " = "Urea",
                                       " urea" = "Urea",
                                       " Urea" = "Urea",
                                       
                                       " transthyre- tin (TTR)" = "TTR", 
                                        " transthyretin (TTR)" = "TTR", 
                                       " transthyretin TTR" = "TTR", 
                                       " TTR" = "TTR", 
                                       "transthyretin TTR" = "TTR",
                                       "transthyretin (TTR)" = "TTR",
                                       "transthyre- tin (TTR)"  = "TTR",
                                       "transferrin" = "TTR",
                                       
                                      "HNF4a" = "HNF4alpha", 
                                     " HNF4a" = "HNF4alpha", 
                                     " HFN4alpha" = "HNF4alpha", 
                                     "  HNF4alpha" = "HNF4alpha", 
                                     "HFN4A" = "HNF4alpha",
                                     "s HNF4a" = "HNF4alpha",
                                     " HNF4alpha" = "HNF4alpha", 
                                     "  HFN4alpha" = "HNF4alpha", 
                                 "hepatocyte nuclear factor 4α (HNF4A)" = "HNF4alpha",
                                   "HFN4alpha"  = "HNF4alpha", 
                                     
                                     
                                     " AFP" = "AFP",
                                     " alpha-fetoprotein (AFP)" = "AFP", 
                                     " alpha-fetoprotein" = "AFP", 
                                     "alpha-fetoprotein levels (HCC marker)" = "AFP", 
                                     " α-fetoprotein (AFP)" = "AFP", 
                                     "alpha-fetoprotein" = "AFP", 
                                     "Alpha-fetoprotein AFP" = "AFP", 
                                     "alpha-fetoprotein (AFP)" = "AFP",
                                     "α-fetoprotein (AFP)" = "AFP",
                                     
                                     
                                     " cytokeratin 19 (CK19)" = "cytokeratin 19 (CK19)", 
                                     " cytokeratin 19" = "cytokeratin 19 (CK19)",
                                     " CK-19" = "cytokeratin 19 (CK19)",
                                     "CK-19" = "cytokeratin 19 (CK19)",
                                     "cytokeratin 19"  = "cytokeratin 19 (CK19)",
                                     
                                     
                                 
                                 "CK18" = "cytokeratin 18 (CK18)", 
                                 
                                 
                                     
                                     "staning for MRP2" = "MRP2", 
                                     " MRP2" = "MRP2",
                        "multidrug resist- ance-associated protein 2 (MRP2)" = "MRP2",
                                     
                                     
                                     "CYP4A4 activity" = "CYP3A4", 
                                      " CYP3A4" = "CYP3A4",              
                                     " CYP3A4" = "CYP3A4", 
                                     "Cyp3A4"= "CYP3A4", 
                                 "cytochrome P450 3A4 (CYP3A4)" = "CYP3A4",
                                 
                                 "Cytochromes 1A2" = "CYP1A2", 
                                 
                                 
                                 
                                 "alpha-1 antitrypsin (A1AT)" = "alpha-1 antitrypsin", 
                                 "alpha-1 antitrypsin (AAT)" = "alpha-1 antitrypsin", 
                                 "Alpha 1 antitrypsin" = "alpha-1 antitrypsin"
                                                     )) 

commentsLiver <- liverMarkerComments_clean %>%  group_by(liverMarkerComment) %>% summarise(n_unique = length(unique(study_ID))) %>%  arrange(desc(n_unique))

commentsLiver
#install.packages("formattable")
library(formattable)

formattable(commentsLiver,
            align =c("l", "r"),
            list(`Indicator Name` = formatter(
              "span", style = ~ style(color = "grey",font.weight = "bold")), 
              `n_unique`= color_bar("yellow")
))
liverMarkerComment n_unique
Albumin 36
NA 23
Urea 16
AFP 12
HNF4alpha 9
CYP3A4 7
TTR 5
CYP1A2 4
MRP2 4
alpha-1 antitrypsin 4
3
cytokeratin 18 (CK18) 3
cytokeratin 19 (CK19) 3
ASGR1 2
CD31 2
CYP 2
CYP2B6 2
CYP2C19 2
CYP2C9 2
2C19 1
3-dioxygenase 1
3A4 1
ABCC2 1
ACTA2 1
ALDOB 1
ASGPR1 1
ATP 1
COLA1 1
CYP1A1 1
CYP2E1 1
Collagen A1 1
E-cadherin 1
Foxa3 1
GST 1
Glutathione S-transferase alpha 1 1
MDR1 1
MMP2 1
NMDA receptor 1 iso- form NR1-2 variant 1
NR1/2(PXR) 1
NR1H4(FXR) 1
OCT 1
SERPINA1 1
TIMP1 1
Zo-1 1
alpha-smooth muscle actin (α-SMA) 1
asialoglycoprotein receptor 1 1
beta-Catenin 1
bile salt export pump (BSEP) 1
ceruloplasmin 1
glucose_x0002_6-phosphatase catalytic subunit (ABCG2) 1
glutamate dehydrogenase 1
glutathione s-transferase alpha (alpha-GST) 1
hepatic markers ATP-binding cassette super-family G member 2 (G6PC) 1
hepatocyte nuclear factor 1α (HNF1A) 1
hepatocyte nuclear factor 3β (HNF3B) 1
hepatocyte nuclear factor 6 (HNF6) 1
organic anion transporter protein 1B3 (OATP1B3) 1
secretion 1
total bile acids 1
total protein 1
tryptophan 2 1
tyrosine amino-transferase 1
## trying 6.4 
# which metabolites were analysed 
t <- table(reconciled$`6.4 Which metabolites were analyzed in the study?_5652d702-1441-4234-b37d-f0b44d64c5e9_Answer`)

liverMetabolite <- separate_rows(reconciled, `6.4 Which metabolites were analyzed in the study?_5652d702-1441-4234-b37d-f0b44d64c5e9_Answer`
   ,sep=";")

liverMetabolite$`6.4 Which metabolites were analyzed in the study?_5652d702-1441-4234-b37d-f0b44d64c5e9_Comments` <- str_replace_all(liverMetabolite$`6.4 Which metabolites were analyzed in the study?_5652d702-1441-4234-b37d-f0b44d64c5e9_Comments`, "[\n]" , "")

liverMetabolite_comments <-  liverMetabolite %>% select(c(study_ID, `6.4 Which metabolites were analyzed in the study?_5652d702-1441-4234-b37d-f0b44d64c5e9_Answer`, `6.4 Which metabolites were analyzed in the study?_5652d702-1441-4234-b37d-f0b44d64c5e9_Comments`))


commentsLiverMetabolite <- liverMetabolite_comments %>%  group_by(`6.4 Which metabolites were analyzed in the study?_5652d702-1441-4234-b37d-f0b44d64c5e9_Answer`) %>% summarise(n_unique = length(unique(study_ID))) %>%  arrange(desc(n_unique))


otherLiverMetabolite <- liverMetabolite_comments %>%  group_by(`6.4 Which metabolites were analyzed in the study?_5652d702-1441-4234-b37d-f0b44d64c5e9_Comments`) %>% summarise(n_unique = length(unique(study_ID))) %>%  arrange(desc(n_unique))

# print(otherLiverMetabolite)

#install.packages("formattable")
library(formattable)

formattable(commentsLiverMetabolite,
            align =c("l", "r"),
            list(`Indicator Name` = formatter(
              "span", style = ~ style(color = "grey",font.weight = "bold")), 
              `n_unique`= color_bar("yellow")
))
6.4 Which metabolites were analyzed in the study?_5652d702-1441-4234-b37d-f0b44d64c5e9_Answer n_unique
Albumin 47
Urea 24
None 15
Other 7
Bile acid 3
#### CLEAN THIS!! 
formattable(otherLiverMetabolite, 
             align = c("l", "r"), 
             list(`Indicator Name` = formatter(
              "span", style = ~ style(color = "grey",font.weight = "bold")), 
              `n_unique`= color_bar("yellow")
            
            ))
6.4 Which metabolites were analyzed in the study?_5652d702-1441-4234-b37d-f0b44d64c5e9_Comments n_unique
NA 56
ASS, involved in Urea cycle 1
Alpha-fetoprotein AFP; transthyretin TTR 1
Glucose 1
albumin, alpha-fetoprotein, MKI67, Casp8 1
alpha-fetoprotein, alpha-1-antitrypsin 1
aspartate, formate, glycine, histidine and tryptophan 1
transferrin, ceruloplasmin, alpha-1 antitrypsin 1
#####################


# WHERE
table(reconciled$`6.1.1 Where were the liver markers measured?_a70225ae-f529-4b91-bcc9-8081d7efc6e2_Answer`)
## 
##        Cells        Media  Media;Cells Not reported 
##           10           15           19           19
       # Cells        Media  Media;Cells Not reported 
       #    10           15           19           19 
barplot(table(reconciled$`6.1.1 Where were the liver markers measured?_a70225ae-f529-4b91-bcc9-8081d7efc6e2_Answer`), ylab = "Number of studies", cex.names=.7, col = "yellow")

# CYP450 
table(reconciled$`6.2 Does the study analyse the Cytochrome P450 CYP450 level in the print?_3c21cc1f-1431-49c7-ad8f-bda83956828a_Answer`)
## 
##  No Yes 
##  33  30
 # No Yes 
 # 33  30 

barplot(table(reconciled$`6.2 Does the study analyse the Cytochrome P450 CYP450 level in the print?_3c21cc1f-1431-49c7-ad8f-bda83956828a_Answer`), ylab = "Number of studies", cex.names=.7, col = "yellow")

table(reconciled$`6.2.1 If yes, which cytochrome isoforms were analysed?_62bdffd7-d9c7-4646-9f66-9510f5bf2649_Answer`)
## 
##                                                                                                                 Cytochrome P450 1A2 (CYP1A) 
##                                                                                                                                           4 
##                                                                                     Cytochrome P450 1A2 (CYP1A);Cytochrome P450 2E1 (CYP2E) 
##                                                                                                                                           1 
##                                                                                     Cytochrome P450 1A2 (CYP1A);Cytochrome P450 3A4 (CYP3A) 
##                                                                                                                                           1 
##                                                         Cytochrome P450 1A2 (CYP1A);Cytochrome P450 3A4 (CYP3A);Cytochrome P450 2B6 (CYP2B) 
##                                                                                                                                           1 
##                             Cytochrome P450 1A2 (CYP1A);Cytochrome P450 3A4 (CYP3A);Cytochrome P450 2B6 (CYP2B);Cytochrome P450 2C9 (CYP2C) 
##                                                                                                                                           1 
## Cytochrome P450 1A2 (CYP1A);Cytochrome P450 3A4 (CYP3A);Cytochrome P450 2B6 (CYP2B);Cytochrome P450 2C9 (CYP2C);Cytochrome P450 2D6 (CYP2D) 
##                                                                                                                                           2 
## Cytochrome P450 1A2 (CYP1A);Cytochrome P450 3A4 (CYP3A);Cytochrome P450 2B6 (CYP2B);Cytochrome P450 2C9 (CYP2C);Cytochrome P450 2E1 (CYP2E) 
##                                                                                                                                           1 
##                             Cytochrome P450 1A2 (CYP1A);Cytochrome P450 3A4 (CYP3A);Cytochrome P450 2C9 (CYP2C);Cytochrome P450 2D6 (CYP2D) 
##                                                                                                                                           1 
##                                                                               Cytochrome P450 1A2 (CYP1A);Cytochrome P450 3A4 (CYP3A);Other 
##                                                                                                                                           3 
##                                                                                                                 Cytochrome P450 2C9 (CYP2C) 
##                                                                                                                                           1 
##                                                                                                                 Cytochrome P450 2E1 (CYP2E) 
##                                                                                                                                           1 
##                                                                                                                 Cytochrome P450 3A4 (CYP3A) 
##                                                                                                                                           9 
##                                                                                     Cytochrome P450 3A4 (CYP3A);Cytochrome P450 2D6 (CYP2D) 
##                                                                                                                                           1 
##                                                         Cytochrome P450 3A4 (CYP3A);Cytochrome P450 2D6 (CYP2D);Cytochrome P450 2E1 (CYP2E) 
##                                                                                                                                           1 
##                                                                                                                                Not reported 
##                                                                                                                                           2
## output needs cleaning

liverCytochome <- separate_rows(reconciled, `6.2.1 If yes, which cytochrome isoforms were analysed?_62bdffd7-d9c7-4646-9f66-9510f5bf2649_Answer`
   ,sep=";")

liverCytochome_only <-  liverCytochome %>% select(c(study_ID, `6.2.1 If yes, which cytochrome isoforms were analysed?_62bdffd7-d9c7-4646-9f66-9510f5bf2649_Answer`, `6.2.1 If yes, which cytochrome isoforms were analysed?_62bdffd7-d9c7-4646-9f66-9510f5bf2649_Comments`))


liverCytochome_only <- liverCytochome_only %>%  group_by(`6.2.1 If yes, which cytochrome isoforms were analysed?_62bdffd7-d9c7-4646-9f66-9510f5bf2649_Answer`) %>% summarise(n_unique = length(unique(study_ID))) %>%  arrange(desc(n_unique))

formattable(liverCytochome_only,
            align =c("l", "r"),
            list(`Indicator Name` = formatter(
              "span", style = ~ style(color = "grey",font.weight = "bold")), 
              `n_unique`= color_bar("yellow")
))
6.2.1 If yes, which cytochrome isoforms were analysed?_62bdffd7-d9c7-4646-9f66-9510f5bf2649_Answer n_unique
NA 33
Cytochrome P450 3A4 (CYP3A) 21
Cytochrome P450 1A2 (CYP1A) 15
Cytochrome P450 2C9 (CYP2C) 6
Cytochrome P450 2B6 (CYP2B) 5
Cytochrome P450 2D6 (CYP2D) 5
Cytochrome P450 2E1 (CYP2E) 4
Other 3
Not reported 2
## agonists
table(reconciled$`6.3 Have agonists of the receptors for the inducibility of CYPs been applied?_ac9f38a8-8fe2-44de-a180-24fddd78fb59_Answer`)
## 
##  No Yes 
##  54   9
 # No Yes 
 # 54   9 
barplot(table(reconciled$`6.3 Have agonists of the receptors for the inducibility of CYPs been applied?_ac9f38a8-8fe2-44de-a180-24fddd78fb59_Answer`), ylab = "Number of studies", cex.names=.7, col = "yellow")

Quality

Does the study describe quality assurance?

table(reconciled$`5.3 Does the study describe quality-assuring assays for the printed model?_09745b80-9723-4e5c-8a47-dfc8a9c71a6d_Answer`)
## 
## Yes 
##  63
# Yes 
#  63

Which assays were performed?

library(tidyverse)
### messy - needs cleaning
messy_assay <- table(reconciled$`5.3.1 Which assays were performed to assure the quality of the liver model?_8a415412-28c6-48ff-840a-538ea69a068f_Answer`)
# needs cleaning 


assays <- separate_rows(reconciled, `5.3.1 Which assays were performed to assure the quality of the liver model?_8a415412-28c6-48ff-840a-538ea69a068f_Answer` ,sep=";")

assays_heat <- assays[,c(1, 91)]

colnames(assays_heat) <- c("study_ID", "assay")

new <- assays_heat %>% group_by(assay) %>% summarize(n_unique = length(unique(study_ID)))

new$n_unique <- as.numeric(new$n_unique)

sort_new <- new %>% arrange(desc(n_unique))


#install.packages("formattable")
library(formattable)

formattable(sort_new,
            align =c("l", "r"),
            list(`Indicator Name` = formatter(
              "span", style = ~ style(color = "grey",font.weight = "bold")), 
              `n_unique`= color_bar("lightgreen")
))
assay n_unique
Viability test 47
Histological characterization 45
Live/Dead Cell Staining 44
Enzyme linked immunosorbent Assay (ELISA) of liver markers 30
Real-time quantitative PCR of liver markers 28
Rheological test 23
Mechanical stiffness 15
Size measurement 13
Biodegradation 4
Biocompatibility 3
### 10 different tests are used across 63 papers, a total of 252 tests were used. 
# the most popular are listed below








## also how many assay were performed? 1, 2, 3, 4, 5, or more. 


counts <- assays_heat %>% group_by(study_ID) %>% summarize(n_unique = length(unique(assay)))

table(counts$n_unique)
## 
##  1  2  3  4  5  6  7 
##  4 10  6 17 16  8  2
 # 1  2  3  4  5  6  7 
 # 4 10  6 17 16  8  2

hist(counts$n_unique, xlab = "Number of Assays Reported", ylab = "Number of Papers", main = "Number of Assays Peformed per Paper",)

Applications in the paper

# Application 
table(reconciled$`7.1 Do the authors apply the model in the study?_a6895d38-a9ed-4605-a092-4f06ebbd9e2b_Answer`)
## 
##  No Yes 
##  35  28
 # No Yes 
 # 35  28 

barplot(table(reconciled$`7.1 Do the authors apply the model in the study?_a6895d38-a9ed-4605-a092-4f06ebbd9e2b_Answer`), ylab = "Number of studies", cex.names=.7, col = "gray")

# field of application 
table(reconciled$`7.1.1 please select the field of application. _d332c2ee-9864-434f-8595-90305808e32d_Answer`)
## 
##                                                          Disease modeling 
##                                                                         3 
##                                                       Drug dosage testing 
##                                                                         2 
##                                      Drug dosage testing;Disease modeling 
##                                                                         1 
## Drug dosage testing;Xenograft (implantation into animal);Disease modeling 
##                                                                         1 
##                                                 Implant / Medical surgery 
##                                                                         1 
##                                                                     Other 
##                                                                         3 
##                                                          Toxicity testing 
##                                                                        10 
##                                      Toxicity testing;Drug dosage testing 
##                                                                         4 
##                                Toxicity testing;Drug dosage testing;Other 
##                                                                         1 
##                                      Xenograft (implantation into animal) 
##                                                                         2